package com.corx.network.mysqlstorage.repository;

import com.corx.network.mysqlstorage.common.PageQuery;
import com.corx.network.mysqlstorage.common.PageResult;
import com.corx.network.mysqlstorage.model.Device;

import java.util.List;
import java.util.Optional;

/**
 * 设备 Repository
 * @author gx
 * @version 1.0.0
 */
public interface DeviceRepository {
    Optional<Device> findById(Long id);

    Optional<Device> findByDeviceCode(String deviceCode);

    List<Device> findByNetworkId(Long networkId);

    PageResult<Device> findByPage(Device model, PageQuery pageQuery);

    void save(Device model);

    void update(Device model);

    void delete(Long id);
}
